<%@ page language="java" import="java.util.*,java.sql.*" pageEncoding="utf-8"%>
<%
request.setCharacterEncoding("utf-8");

String adminname=request.getParameter("adminname");
String adminpass=request.getParameter("adminpass");


com.zipishu.DataBaseConnection db = new com.zipishu.DataBaseConnection();
Connection con=db.getConnection();

Connection dbc=db.getConnection();
String sql="select * from admin where adminname=? and adminpass=?";

PreparedStatement pstmt=dbc.prepareStatement(sql);
pstmt.setString(1,adminname);
pstmt.setString(2,adminpass);
ResultSet rs=pstmt.executeQuery();

if(rs.next()){
session.setAttribute("ADMIN", adminname);
response.sendRedirect("admin_index.jsp");
}else
{
response.sendRedirect("login.jsp");
}



//if(1>0)
//{
//session.setAttribute("ADMIN", adminname);
//response.sendRedirect("admin_index.jsp");
//}
%>





 
